package com.gscitysfy.cus.drain.modules.duty.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
 * 值班人员换Excel实体
 * @author 葛守跃
 */
@Getter
@Setter
@EqualsAndHashCode
public class MoperDutyMnPeopleExcel{
    /**
     * 用户姓名
     */
    @ExcelProperty("姓名")
    private String coamPersonUsername;

    /**
     * 人员类别
     */
    @ExcelProperty("人员类别")
    private String coamPersonType;

    /**
     * 值班人员编号
     */
    @ExcelProperty("人员编号")
    private Long coamPersonOrder;

    /**
     * 自动排班：0 否 1是
     */
    @ExcelIgnore
    private Integer coamAutodutyFlag;

    public void setCoamAutodutyFlag(Integer coamAutodutyFlag) {
        this.coamAutodutyFlag = coamAutodutyFlag;
        if(!Objects.isNull(coamAutodutyFlag)){
            if(coamAutodutyFlag.equals(0)){
                this.coamAutodutyFlagDesc = "否";
            }else{
                this.coamAutodutyFlagDesc = "是";
            }
        }
    }

    /**
     * 自动排班：0 否 1是
     */
    @ExcelProperty("自动排班")
    private String coamAutodutyFlagDesc;

    /**
     * 值班状态：0 停用 1启用
     */
    @ExcelIgnore
    private String coamDutyState;

    public void setCoamDutyState(String coamDutyState) {
        this.coamDutyState = coamDutyState;
        if(!StringUtils.isEmpty(coamDutyState)){
            if("0".equals(coamDutyState)){
                this.coamDutyStateDesc = "停用";
            }else{
                this.coamDutyStateDesc = "启用";
            }
        }
    }

    /**
     * 值班状态：0 停用 1启用
     */
    @ExcelProperty("值班状态")
    private String coamDutyStateDesc;

    /**
     * 用户性别
     */
    @ExcelProperty("性别")
    private String coamPersonGender;

    /**
     * 联系电话
     */
    @ExcelProperty("联系电话")
    private String coamPersonContactNumber;

    /**
     * 所属专项
     */
    @ExcelProperty("所属专项")
    private String coamSysFlag;

    /**
     * 用户登陆账号
     */
    @ExcelProperty("登陆账号")
    private String coamPersonLoginAccount;

    /**
     * 账号状态
     */
    @ExcelIgnore
    private Integer coamPersonAccountStatus;

    public void setCoamPersonAccountStatus(Integer coamPersonAccountStatus) {
        this.coamPersonAccountStatus = coamPersonAccountStatus;
        if(!Objects.isNull(coamPersonAccountStatus)){
            if (coamPersonAccountStatus.equals(1)){
                this.coamPersonAccountStatusDesc = "未激活";
            }else{
                this.coamPersonAccountStatusDesc = "已激活";
            }
        }
    }

    /**
     * 账号状态
     */
    @ExcelProperty("账号状态")
    private String coamPersonAccountStatusDesc;

    /**
     * 用户角色
     */
    @ExcelIgnore
    private String coamPersonRole;

}
